package se.hb.eme.api.helpers;

import java.io.Serializable;


public enum ServiceTypeEnum implements Serializable{
	PRODUCERSERVICE(0),
	CONSUMERSERVICE(1);
	
	ServiceTypeEnum(Integer value) {	
		this.value = value;
	}
	
	private final Integer value;
	
	public Integer value() 
	{ 		
		return value;
	}
	
	public Integer getId() {
		return value;
	}	
	 
	public String getName(){
		switch (value.intValue())
		{
			case 0: return "PRODUCERSERVICE";
			case 1: return "CONSUMERSERVICE";
		}
		return "";
	}
	
	@Override
	public String toString() {		
		switch (value.intValue())
		{
			case 0: return "Producer service";
			case 1: return "Consumer service";
		}		
		return super.toString();
	}
	
	public int compareTo(Integer i)
	{
		return this.value.compareTo(i);
	}	
}
